<!--/*
* Copyright (c) 2025 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/-->

<!DOCTYPE html>
<html>
<body>
<button type='button' onclick='callArkTS()'>Click Me!</button>
<p id='demo'></p>
<script>
    // 写法1
    class Student {
        constructor(nameList) {
            this.methodNameListForJsProxy = nameList;
        }

        hello(param) {
            testObjName.toString(param);
        }
    }
    let st = new Student(['hello']);

    // 写法2
    //创建一个构造器，构造函数首字母大写
    function Obj1() {
        this.methodNameListForJsProxy = ['hello'];
        this.hello = function(param) {
            testObjName.toString(param);
        };
    }
    //利用构造器，通过new关键字生成对象
    let st1 = new Obj1();

    function callArkTS() {
        testObjName.test(st);
        testObjName.test(st1);
    }
</script>
</body>
</html>
